|
In computing, a distance oracle (DO) is a data structure for calculating distances between vertices in a graph. == Introduction == Let ''G''(''V'',''E'') be an undirected, weighted graph, with ''n'' = |''V''| nodes and ''m'' = |''E''| edges. We would like to answer queries of the form "what is the distance between the nodes ''s'' and ''t''?". One way to do this is just run the Dijkstra algorithm. This takes time , and requires no extra space (besides the graph itself). In order to answer many queries more efficiently, we can spend some time in pre-processing the graph and creating an auxiliary data structure. A simple data structure that achieves this goal is a ''matrix'' which specifies, for each pair of nodes, the distance between them. This structure allows us to answer queries in constant time , but requires extra space. It can be initialized in time using an all-pairs shortest paths algorithm, such as the Floyd–Warshall algorithm. A DO lies between these two extremes. It uses less than space in order to answer queries in less than time. Most DOs have to compromise on accuracy, i.e. they don't return the accurate distance but rather a constant-factor approximation of it. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Distance oracle」の詳細全文を読む スポンサード リンク
|